package com.sky.mapper;/*
@author sun
@date 24/07/15
@project IntelliJ IDEA
*/

import com.sky.annotation.AutoFill;
import com.sky.dto.SetmealPageQueryDTO;
import com.sky.entity.Setmeal;
import com.sky.enumeration.OperationType;
import com.sky.vo.SetmealVO;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.data.domain.Page;

@Mapper
public interface SetmealMapper {
    void insertOneSetmeal(Setmeal setmeal);

    Page<SetmealVO> pageQuery(SetmealPageQueryDTO setmealPageQueryDTO);

    @AutoFill(value = OperationType.UPDATE)
    void update(Setmeal setmeal);

    SetmealVO getByIdWithDish(Long id);

    @Delete("delete from setmeal where id = #{id}") // 根据主表主键id先删除
    void delSetmeal(Long id);

    @Select("select * from setmeal where id = #{id}") // 根据id查到套餐所有字段然后判断状态
    Setmeal getById(Long id);
}
